import styles from './index.less';
// 配置antd 中文
import zhCN from 'antd/lib/locale/zh_CN';
import { ConfigProvider } from 'antd';
import Header from './Header';
import Footer from './Footer';
import ErrorBoundary from '@/components/common/ErrorBoundary';
import ErrorFallback from './ErrorFallback';
import ScrollToTop from '@/components/common/ScrollToTop';

function BasicLayout(props) {
  return (
    <ConfigProvider locale={zhCN}>
      <div className={styles.normal}>
        <Header />
        <ErrorBoundary FallbackComponent={ErrorFallback}>
          <ScrollToTop>{props.children}</ScrollToTop>
        </ErrorBoundary>
        <Footer />
      </div>
    </ConfigProvider>
  );
}

export default BasicLayout;
